<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<c:url value="/resources/css/view.css"/>" >
</head>
<body>
 

<form:errors path="user" cssClass="error"/>
<c:if test="${userExists}">
	<td><c:out value="User alreadry exits!"/></td>
</c:if>
<c:if test="${emailExists}">
	<td><c:out value="Email alreadry exits!"/></td>
</c:if>
<form:form modelAttribute="user" method="POST" action="userForm">
 <table>
 <form:hidden path="role.roleId"/>
  <tr>
   <td><form:label path="name">name:</form:label></td>
   <td><form:input path="name"/></td>
   <td><form:errors path="name" cssClass="error"/></td>
  </tr>
  
  <tr>
   <td><form:label path="password">password:</form:label></td>
   <td><form:input type="password" path="password"/></td>
   <td><form:errors path="password" cssClass="error"/></td>
  </tr>
  
<!--   <tr> -->
<%--    <td><form:label path="retypePassword">confirm password:</form:label></td> --%>
<%--    <td><form:input type="retypePassword" path="retypePassword"/></td> --%>
<!--   </tr> -->
 
  <tr>
   <td><form:label path="email">email</form:label></td>
   <td><form:input path="email"/></td>
   <td><form:errors path="email" cssClass="error"/></td>
  </tr>
	

 </table>
 <table>
 <tr>
 	<td><input type="submit" value="Save" /></td>
 	<c:if test="${!admin}">
		<td><a href="<c:url value="/home"/>" > home </a></td>
	</c:if>
	<c:if test="${admin}">
		<td><a href="<c:url value="/admin"/>" > back </a></td>
	</c:if>
</tr>
</table>
</form:form>
</body>
</html>